from time import sleep

import flet as ft


def main(page: ft.Page):
    pb = ft.ProgressBar(width=400)

    page.add(
        ft.Text("线性进度指示器", style="headlineSmall"),
        ft.Column([ft.Text("正在进行某些操作..."), pb]),
        ft.Text("不确定型进度条", style="headlineSmall"),
        ft.ProgressBar(width=400, color="amber", bgcolor="#eeeeee"),
    )

    for i in range(0, 101):
        pb.value = i * 0.01
        sleep(0.1)
        page.update()


ft.app(target=main)
